home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
003
/
fdm.lbr
/
fdm.doc
< prev
Wrap
Text File
|
2011-01-29
|
5KB
|
118 lines
Documentation for use with FDM Page 1 of 1
File Drawer Manager
FDM is a keyed file maintenance system. It manages ASCII files in key
order. Each data file that FDM manages has a .DAT suffix on it. Two
supporting files with the same name but different suffixes are created for
use in managing the data file. One is the index file, with suffix .NDX, and
the other is the format file, with suffix .FMT. The format file contains
information about the fields and the screen layout. It is created only once,
the first time the data file is created.
To get into the File Drawer Manager, type FDM from the DOS prompt.
Optionally, the file name you wish to manage can be placed on this line.
Examples: >FDM
>FDM Myfile
>FDM B:Myfile
If the file is new, you will have to answer 'Y' to the 'New File?' prompt.
Then you will need to define the file. First type in the name of the screen.
This title will appear on all online screens while dealing with this file.
Then hit Return. Now enter all screen prompts for up to 20 fields which will
be collected in your file. Hit Return when all fields have been entered.
Remember that the first data field is going to be your key field.
Now enter the data length for each of the fields entered. If all is okay,
hit Return. Otherwise, hit ESC, then Return. You will then be allowed to
redo any of it.
Once the file is defined, you will be put into browse mode. Of course,
if your file is new, you will need to get into Add mode. Modes can be
switched whenever you are being prompted for a new key. If you are in Add
or Update mode, and you wish to cancel out of the transaction, hit ESC followed
by Return. Deletes will be verified with a 'Y' or 'N'.
The following editing keys can be used with FDM:
Ctrl-A - Go into Add mode
Ctrl-B - Go into Browse mode
Ctrl-D - Go into Delete mode
Ctrl-N - Get the next record in key sequence
Ctrl-P - Get the previous record in key sequence
Ctrl-Q - Leave FDM
Ctrl-S - Toggle the Save On/Off toggle. This is used when
adding records. Save On initializes a new record to an
image of the last record reviewed. This saves typing
in some cases. Save Off initializes a new record to
spaces.
Ctrl-U - Go into Update mode
Home - Go to the beginning of a field
End - Go to the end of a field
Ins - Toggle Insert mode on or off. This allows characters to
be inserted in between two characters.
Del - Deletes the character under the cursor and moves all
characters to the right of the cursor left one space.
Left Tab - Moves the cursor left one character and erases as it goes.
Right Tab - Moves the cursor to the next field.
Right Arrow - Moves the cursor right one character.
Left Arrow - Moves the cursor left one character.
Down Arrow - Moves the cursor to the next field down.
Up Arrow - Moves the cursor to the previous field.
Ctrl-End - Erases the field from the cursor to the end of the field.
Ctrl-Right Arrow - Moves the cursor right 5 characters.
Ctrl-Left Arrow - Moves the cursor left 5 characters.
Documentation for use with FDM Page 2 of 2
File Drawer Manager
The files created by FDM are ASCII files which can be read by programs
written in BASIC or PASCAL. Each data record is has a two byte status code
in the beginning which is used by the index routine. This is '00' for a
valid record. Otherwise, you want to ignore it. Also, the very first
record of the data file is a control record and should be ignored. The
record length is 2 plus the length of all fields you requested. An example
BASIC program follows to read a data file consisting of name and occupation,
where name can be 30 characters and occupation 20 characters:
10 OPEN "B:EMPLOYEE.DAT" AS #1 LEN=52
20 FIELD 1, 2 AS STATUS$, 30 AS NME$, 20 AS OCCUP$
30 GET 1 ' Skip past first record
40 IF EOF(1) THEN GOTO 99
50 GET 1
60 IF STATUS$ = "00" THEN PRINT NME$, OCCUP$
70 GOTO 40
99 CLOSE:END
An example PASCAL program using the same example looks like this:
Program Readit;
Type
Rec =
Record
Status : Array[1..2] of Char;
Name : Array[1..30] of Char;
Occupation : Array[1..20] of Char;
End;
Var
DataRec : Rec;
DataFile : File of Rec;
Begin {Readit}
Assign (DataFile, 'B:Employee.Dat');
Reset(DataFile);
While Not Eof(DataFile) Do
With DataRec Do
Begin
Read(DataFile,DataRec);
If Status = '00' Then
Writeln (Name, ' - ', Occupation);
End;
Close(DataFile);
End.